package com.yj.rest;

import com.yj.anno.RpcReference;
import com.yj.interfaces.IUserService;
import com.yj.pojo.User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
@RequestMapping("user")
public class UserController {


    @RpcReference
    private IUserService userService;

    @GetMapping("{id}")
    public User getUser(@PathVariable Integer id) {
        return userService.getUserById(id);
    }

    @GetMapping("get")
    public String hello() {
        return "hello world";
    }
}
